<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}

<style>
	.layui-form-item .layui-input-inline{width:600px;}
	.layui-form-item .layui-input-block{ margin-right:100px;}
</style>

<div class="x-nav">
	<span class="layui-breadcrumb">
		<a>首页</a>
		<a>文章管理</a>
		<a>文章管理</a>
	</span>
	<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
		<i class="layui-icon" style="line-height:30px">ဂ</i>
	</a>
	<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin:3px 5px 0 0;float:right" href="?m={$m}&c={$c}" title="返回">
		<i class="layui-icon" style="line-height:30px">&lt;</i>
	</a>
</div>

<div class="x-body">
	<div class="layui-main">
		<form class="layui-form" action="?" method="post">
			<input type="hidden" name="m" value="{$m}" />
			<input type="hidden" name="c" value="{$c}" />
			<input type="hidden" name="a" value="{$a}" />
			<input type="hidden" name="id" value="{$id}" />
			<div class="layui-form-item">
				<label class="layui-form-label">文章分类：</label>
				<div class="layui-input-inline">
					<select name="cid">
						{loop $categorys as $key => $val}
						<option value="{$val['id']}"{if $val['id'] == $data['cid']} selected="selected"{/if}>{$val['title']}</option>
						{/loop}
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">彩票种类：</label>
				<div class="layui-input-inline">
					<select name="lotteryid">
						<option value="0">选择彩票</option>
						{loop $lotterys as $key => $val}
						<option value="{$val['id']}"{if $val['id'] == $data['lotteryid']} selected="selected"{/if}>{$val['title']}</option>
						{/loop}
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">标题：</label>
				<div class="layui-input-inline"><input type="text" name="title" required="true" value="{$data['title']}" placeholder="请输入文章标题" autocomplete="off" class="layui-input"></div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">图片：</label>
				<div class="layui-input-inline">
					<input type="text" class="layui-input" id="thumb" name="thumb" value="{$data['thumb']}" />						
				</div>
				<div class="layui-word-aux"><input type="button" onclick="imageupload('thumb')" value="上传图片" class="layui-btn" /></div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">关键词：</label>
				<div class="layui-input-inline"><input type="text" name="keyword" value="{$data['keyword']}" placeholder="请输入关键词" autocomplete="off" class="layui-input"></div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">摘要：</label>
				<div class="layui-input-inline">
					<textarea class="layui-textarea" name="description" style="width: 600px;">{$data['description']}</textarea>
				</div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">内容：</label>
				<div class="layui-input-block">
					{createUEditor('content',$data['content'])}
				</div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<a class="layui-btn" href='?m={$m}&c={$c}'>返回</a>
					<button class="layui-btn" type="submit">确定</button>
				</div>
			</div>
		</form>
	</div>
</div>

{template index/footer}